﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Game1942.Library.Background;

namespace Game1942.Library.Planes
{
    public class CazaGroup
    {
        private readonly List<Caza> group = new List<Caza>();
        private int units = 4;
        private const int OffsetX = Constants.Caza.Width;
        private const int OffsetY = Constants.Caza.Height/2;
        // No hace falta, lo hereda de Element -> LivingElement -> ComputerElement -> Aircraft
		//public bool Located { get; set; }

        public CazaGroup()
        {
            for (int i = 0; i < units; i++)
            {
                group.Add(new Caza());
            }
        }


        /*
        public void SetPosition(Point aPosition)
        {
            for (int index = 0; index < group.Count; index++)
            {
                var offset = new Point(index*OffsetX, index*OffsetY);
                aPosition.Plus(offset);
                group[index].SetPosition(aPosition);
            }
        }*/


        public Point Offset()
        {
            return new Point(OffsetX,OffsetY);
        }

        public Caza Next()
        {
            if (group.Count == 0) return null;
            var caza = group.FirstOrDefault();
            group.Remove(caza);
            return caza;
        }
    }
}
